#include "gfx/legato/generated/screen/le_gen_screen_Screen3.h"

// screen member widget declarations
leWidget* root0;

leWidget* Screen3_PanelWidget0;
leCircleWidget* Screen3_Circle10;
leCircleWidget* Screen3_Circle25;
leCircleWidget* Screen3_Circle40;
leCircleWidget* Screen3_Circle55;
leCircleWidget* Screen3_Circle70;
leCircleWidget* Screen3_Circle85;
leLabelWidget* Screen3_TouchAnywhereLabel;

static leBool initialized = LE_FALSE;
static leBool showing = LE_FALSE;

leResult screenInit_Screen3(void)
{
    if(initialized == LE_TRUE)
        return LE_FAILURE;

    initialized = LE_TRUE;

    return LE_SUCCESS;
}

leResult screenShow_Screen3(void)
{
    if(showing == LE_TRUE)
        return LE_FAILURE;

    // layer 0
    root0 = leWidget_New();
    root0->fn->setSize(root0, 800, 480);
    root0->fn->setBackgroundType(root0, LE_WIDGET_BACKGROUND_NONE);
    root0->fn->setMargins(root0, 0, 0, 0, 0);
    root0->flags |= LE_WIDGET_IGNOREEVENTS;
    root0->flags |= LE_WIDGET_IGNOREPICK;

    Screen3_PanelWidget0 = leWidget_New();
    Screen3_PanelWidget0->fn->setPosition(Screen3_PanelWidget0, 0, 0);
    Screen3_PanelWidget0->fn->setSize(Screen3_PanelWidget0, 800, 480);
    Screen3_PanelWidget0->fn->setScheme(Screen3_PanelWidget0, &BaseBlack_ForegroundWhite);
    root0->fn->addChild(root0, (leWidget*)Screen3_PanelWidget0);

    Screen3_Circle10 = leCircleWidget_New();
    Screen3_Circle10->fn->setPosition(Screen3_Circle10, 0, 0);
    Screen3_Circle10->fn->setSize(Screen3_Circle10, 800, 480);
    Screen3_Circle10->fn->setScheme(Screen3_Circle10, &BaseBlack_ForegroundRed);
    Screen3_Circle10->fn->setRadius(Screen3_Circle10, 10);
    Screen3_Circle10->fn->setThickness(Screen3_Circle10, 2);
    root0->fn->addChild(root0, (leWidget*)Screen3_Circle10);

    Screen3_Circle25 = leCircleWidget_New();
    Screen3_Circle25->fn->setPosition(Screen3_Circle25, 0, 0);
    Screen3_Circle25->fn->setSize(Screen3_Circle25, 800, 480);
    Screen3_Circle25->fn->setScheme(Screen3_Circle25, &BaseBlack_ForegroundRed);
    Screen3_Circle25->fn->setRadius(Screen3_Circle25, 25);
    Screen3_Circle25->fn->setThickness(Screen3_Circle25, 2);
    root0->fn->addChild(root0, (leWidget*)Screen3_Circle25);

    Screen3_Circle40 = leCircleWidget_New();
    Screen3_Circle40->fn->setPosition(Screen3_Circle40, 0, 0);
    Screen3_Circle40->fn->setSize(Screen3_Circle40, 800, 480);
    Screen3_Circle40->fn->setScheme(Screen3_Circle40, &BaseBlack_ForegroundRed);
    Screen3_Circle40->fn->setRadius(Screen3_Circle40, 40);
    Screen3_Circle40->fn->setThickness(Screen3_Circle40, 2);
    root0->fn->addChild(root0, (leWidget*)Screen3_Circle40);

    Screen3_Circle55 = leCircleWidget_New();
    Screen3_Circle55->fn->setPosition(Screen3_Circle55, 0, 0);
    Screen3_Circle55->fn->setSize(Screen3_Circle55, 800, 480);
    Screen3_Circle55->fn->setScheme(Screen3_Circle55, &BaseBlack_ForegroundRed);
    Screen3_Circle55->fn->setRadius(Screen3_Circle55, 55);
    Screen3_Circle55->fn->setThickness(Screen3_Circle55, 2);
    root0->fn->addChild(root0, (leWidget*)Screen3_Circle55);

    Screen3_Circle70 = leCircleWidget_New();
    Screen3_Circle70->fn->setPosition(Screen3_Circle70, 0, 0);
    Screen3_Circle70->fn->setSize(Screen3_Circle70, 800, 480);
    Screen3_Circle70->fn->setScheme(Screen3_Circle70, &BaseBlack_ForegroundRed);
    Screen3_Circle70->fn->setRadius(Screen3_Circle70, 70);
    Screen3_Circle70->fn->setThickness(Screen3_Circle70, 2);
    root0->fn->addChild(root0, (leWidget*)Screen3_Circle70);

    Screen3_Circle85 = leCircleWidget_New();
    Screen3_Circle85->fn->setPosition(Screen3_Circle85, 0, 0);
    Screen3_Circle85->fn->setSize(Screen3_Circle85, 800, 480);
    Screen3_Circle85->fn->setScheme(Screen3_Circle85, &BaseBlack_ForegroundRed);
    Screen3_Circle85->fn->setRadius(Screen3_Circle85, 85);
    Screen3_Circle85->fn->setThickness(Screen3_Circle85, 2);
    root0->fn->addChild(root0, (leWidget*)Screen3_Circle85);

    Screen3_TouchAnywhereLabel = leLabelWidget_New();
    Screen3_TouchAnywhereLabel->fn->setPosition(Screen3_TouchAnywhereLabel, 80, 440);
    Screen3_TouchAnywhereLabel->fn->setSize(Screen3_TouchAnywhereLabel, 660, 30);
    Screen3_TouchAnywhereLabel->fn->setScheme(Screen3_TouchAnywhereLabel, &BaseWhite_TextBlack);
    Screen3_TouchAnywhereLabel->fn->setHAlignment(Screen3_TouchAnywhereLabel, LE_HALIGN_CENTER);
    Screen3_TouchAnywhereLabel->fn->setVAlignment(Screen3_TouchAnywhereLabel, LE_VALIGN_TOP);
    Screen3_TouchAnywhereLabel->fn->setString(Screen3_TouchAnywhereLabel, (leString*)&string_TouchAnywhere);
    root0->fn->addChild(root0, (leWidget*)Screen3_TouchAnywhereLabel);

    leAddRootWidget(root0, 0);
    leSetLayerColorMode(0, LE_COLOR_MODE_RGB_565);

    showing = LE_TRUE;

    return LE_SUCCESS;
}

void screenUpdate_Screen3(void)
{
}

void screenHide_Screen3(void)
{

    leRemoveRootWidget(root0, 0);
    leWidget_Delete(root0);
    root0 = NULL;

    Screen3_PanelWidget0 = NULL;
    Screen3_Circle10 = NULL;
    Screen3_Circle25 = NULL;
    Screen3_Circle40 = NULL;
    Screen3_Circle55 = NULL;
    Screen3_Circle70 = NULL;
    Screen3_Circle85 = NULL;
    Screen3_TouchAnywhereLabel = NULL;


    showing = LE_FALSE;
}

void screenDestroy_Screen3(void)
{
    if(initialized == LE_FALSE)
        return;

    initialized = LE_FALSE;
}

leWidget* screenGetRoot_Screen3(uint32_t lyrIdx)
{
    if(lyrIdx >= LE_LAYER_COUNT)
        return NULL;

    switch(lyrIdx)
    {
        case 0:
        {
            return root0;
        }
        default:
        {
            return NULL;
        }
    }
}

